
import  time

from selenium import webdriver
from selenium.webdriver.common.by import By


driver = webdriver.Chrome(executable_path='Chromedriver.exe')
# 2.输入访问地址（URL）
driver.get("http://121.43.169.97:8848/pageA.html")
#放大浏览器操作
# driver.maximize_window()
#暂停3秒
time.sleep(3)
#设置窗口尺寸800*600像素
driver.set_window_size(800,600)
#将窗口移动到屏幕坐标0，500
driver.set_window_position(0,500)

#3页面操作
#通过name属性定位页面元素
#定位元素并输入内容
driver.find_element(By.CSS_SELECTOR,"#userA").send_keys("admin")

#内容清除
time.sleep(3)
driver.find_element(By.CSS_SELECTOR,"#userA").clear()

#刷新
time.sleep(3)
driver.refresh()

#获取标题
print(driver.title)

#获取页面地址
print(driver.current_url)

